﻿using System.Data;

namespace TurtleEngine
{
	 /// <summary>
	 ///
	 /// </summary>
	 public static class RestrictionsHelper
	 {
		  /// <summary>
		  /// The restrictions
		  /// </summary>
		  private static DataTable restrictions = new DataTable("Restrictions");

		  /// <summary>
		  /// Gets the restrictions.
		  /// </summary>
		  /// <value>
		  /// The restrictions.
		  /// </value>
		  public static DataTable Restrictions
		  {
				get { return restrictions; }
		  }

		  /// <summary>
		  /// Gets the restrictions.
		  /// </summary>
		  public static void GetRestrictions()
		  {
				restrictions.Clear();
				restrictions = Utility.DBConnection.GetSchema("Restrictions");

				//Utility.PrintDatatable(restrictions);
		  }

		  /// <summary>
		  /// Writes the restrictions.
		  /// </summary>
		  public static void WriteRestrictions()
		  {
				string xmlfile = restrictions.TableName + ".xml";
				string xslFile = restrictions.TableName + ".xsl";
				string htmFile = restrictions.TableName + ".htm";

				Utility.WriteXML(restrictions, restrictions.TableName + ".xml");
				Utility.WriteHTML(xmlfile, xslFile, htmFile);
		  }
	 }
}